<?php echo $header;echo $sidebar ?>


        
		<style>
			a.edit_icon {
		    background: url("<?php echo $this->config->base_url(); ?>assets/admin/admin_images/icons/edit.gif") no-repeat scroll left top transparent;
		    display: inline-block;
		    height: 16px;
		    width: 16px;
			}
			a.delete2_icon {
   	 			background: url("<?php echo $this->config->base_url(); ?>assets/admin/images/icon/delete.png") no-repeat scroll left top transparent;
    			display: inline-block;
    			height: 16px;
    			width: 16px;
			}
			ul.yiiPager {
			    border: 0 none;
			    display: inline;
			    font-size: 11px;
			    line-height: 100%;
			    margin: 0;
			    padding: 0;
			}
			
			ul.yiiPager a:link, ul.yiiPager a:visited {
			    border: 1px solid #9AAFE5;
			    color: #0E509E;
			    font-weight: bold;
			    padding: 1px 6px;
			    text-decoration: none;
			}
			.star {color: red;}
		</style>
		<div class="span10 content">

			<?php echo $hugemenu ?>

			<h1>Campaigns</h1>

			<?php if($this->session->flashdata('message')) {?>
			<div class="alert alert-success alert-dismiss">
				<?php echo $this->session->flashdata('message') ?>
			</div>
			<?php  }?>

<br/>
			<div>							
				<!-- Tab panes -->
				<div class="tab-content">

					
                  <div align="right">
                    <table cellspacing="0" cellpadding="0" border="0" width="20%" >
                      <tbody>
                        <tr>
                          <td width="50%"><input type="button" value="Create New" name="Create"  class="btn btn-primary" onclick="redirectOnClick('campaigns/create')" /></td>
                          <td width="50%"><input type="button" value="Refresh" name="Refresh" class="btn btn-primary" onclick="redirectOnClick('lists')"/></td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
				
					
					
					<!--Listing -->
					
					<table class="table table-striped table-bordered table-hover table-primary">
		                <tbody>
		                    <?php if($msg){?>
		                    <tr>
		                        <td colspan="10" align="left" style="color:#FFF; background-color:#09C; padding:8px" class="msg">
		                            <?php echo $msg;?>
		                        </td>
		                    </tr>
		                    <?php }?>
		                    <thead>
			                    <tr>
		                            <th scope="col">Campaign name</th>
		                            <th scope="col">Status</th>
		                            <th scope="col">Date added</th>
		                            <th scope="col">Schedule sending</th>
		                            <th scope="col">Options</th>
								</tr>
							</thead>
		                	
                            <?php foreach($campaigns as $campaign) { ?>
		                	<tr>	                       
	                            <td><a href="<?php echo "campaigns/setup/".$campaign->campaign_uid;?>"><?php echo $campaign->name;?></a></td>
                                <td><?php echo $campaign->status;?></td>
	                            <td><?php echo $campaign->date_added;?></td>
	                            <td><?php echo $campaign->send_at;?></td>
	                            <td>
                                <a href="<?php echo "campaigns/overview/".$campaign->campaign_uid;?>"><i class="fa-2x icon-info-sign"></i></a> &nbsp;&nbsp;&nbsp;
                                <a href="<?php echo "campaigns/edit/".$campaign->campaign_uid;?>"> <i class="icon-edit"></i></a>&nbsp;&nbsp;&nbsp;
                                <a href="#" onclick="javascript:verifyDelete(<?php echo "'".$campaign->campaign_uid."'";?>)"><i class="icon-remove"></i></a></td>

		                   </tr>
                           <?php } ?>
		                   
		                  
		                        
	                        <tr>
	                            <td align="right" colspan="6"><?php if($pagination_links){?>Go to page:<?php }?>
	                              <ul class="yiiPager" id="yw0">
	                                 <?php echo $pagination_links;?>
	                                    </ul>
	                            </td>
	                        </tr>
		                </tbody>
					</table>
				</div>
			</div>
		</div><!--/content-->
<?php echo $footer ?>
<script>
function redirectOnClick(loc)
{
	window.location.href=loc;
}
function verifyDelete(uid)
{
	var site_url = <?php echo "\"". site_url()."\";";?>
	if(confirm("are you sure you want to delete the list"))
	{
		window.location.href= site_url+"email_marketing/campaigns/delete/"+uid;
	
	}
	
	
}

$(document).ready( function () {
    $(".collapse").collapse()({
      show: false
      });
});
</script>